{extend name="public/base" /}

{block name="title"}<title>FileUpload</title>{/block}

{block name="pjax_container"}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab1" data-toggle="tab">{:lang('preview')}</a></li>
                    <li><a href="#tab2" data-toggle="tab">{:lang('code')}</a></li>
                    <li><a href="#tab3" data-toggle="tab">{:lang('help')}</a></li>
                    <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm"><i class="fa fa-list"></i> {:lang('back')}</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab1">
<div class="alert alert-danger">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <p>如果你在上传配置项配置了：文件上传域名地址【image_url => 当前域名 或 其他域名】，那么上传图片的返回地址前会加上配置的域名地址。如：http://www.sxxblog.com/uploads/image/20180119/suxiaoxin.jpg。</p>
    <p>请勿随意填写【文件上传域名地址】，否则会导致上传图片的返回地址错误，若无特殊通途，保持【文件上传域名地址】为空即可。</p>
</div>
                        <form class="form-horizontal">
{:widget('common/FileUpload/index', [$data, [
    'name' => 'files',
    'title' => '图片上传',
    'placeholder' => '图片上传',
    'validate' => '后面可以加文本提示'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'files2',
    'title' => '图片上传2',
    'placeholder' => '图片上传2',
    'title_col' => '1',
    'content_col' => '11',
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'file',
    'title' => 'file上传',
    'placeholder' => 'file上传',
    'type' => 'file'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'flash',
    'title' => 'flash上传',
    'placeholder' => 'flash上传',
    'type' => 'flash'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'media',
    'title' => 'media上传',
    'placeholder' => 'media上传',
    'type' => 'media'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'files3',
    'title' => '图片上传',
    'placeholder' => '图片上传',
    'readonly' => 'readonly',
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'files4',
    'title' => '图片上传',
    'placeholder' => '图片上传',
    'disabled' => 'disabled',
]])}
                        </form>
                    </div>
                    <div class="tab-pane" id="tab2">
                        <pre>
{literal}
{:widget('common/FileUpload/index', [$data, [
    'name' => 'files',
    'title' => '图片上传',
    'placeholder' => '图片上传',
    'validate' => '后面可以加文本提示'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'files2',
    'title' => '图片上传2',
    'placeholder' => '图片上传2',
    'title_col' => '1',
    'content_col' => '11',
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'file',
    'title' => 'file上传',
    'placeholder' => 'file上传',
    'type' => 'file'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'flash',
    'title' => 'flash上传',
    'placeholder' => 'flash上传',
    'type' => 'flash'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'media',
    'title' => 'media上传',
    'placeholder' => 'media上传',
    'type' => 'media'
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'files3',
    'title' => '图片上传',
    'placeholder' => '图片上传',
    'readonly' => 'readonly',
]])}

{:widget('common/FileUpload/index', [$data, [
    'name' => 'files4',
    'title' => '图片上传',
    'placeholder' => '图片上传',
    'disabled' => 'disabled',
]])}
{/literal}
                        </pre>
                    </div>
                    <div class="tab-pane" id="tab3">
                        <pre>
{literal}
{:widget('common/FileUpload/index', [$data, [
    'name' => 'files',              //组件标签name属性值，对应数据库字段【必须】
    'title' => 'files',             //组件标题【必须】
    'placeholder' => 'files',       //提示内容【非必须】
    'type' => 'image',              //上传类型【非必须，默认值：image。可选：image,flash,media,file】
    'title_col' => '2',             //标题占比（默认2）【非必须】
    'content_col' => '6',           //内容占比（默认6）【非必须】
    'validate' => 'validate',       //提示信息【非必须】
    'validate_col' => '4',          //提示信息占比（默认4）【非必须】
    'readonly' => 'readonly',       //只读【非必须】
    'disabled' => 'disabled',       //禁用【非必须】
]])}
{/literal}
                        </pre>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
{/block}